package com.aidex.biz.service.impl;

import java.util.List;
import com.aidex.common.annotation.DataScope;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.entity.SysUser;
import com.aidex.common.core.domain.entity.SysDept;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.framework.cache.DeptUtils;
import com.aidex.framework.cache.UserUtils;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.aidex.biz.mapper.TaizhangModelMapper;
import com.aidex.biz.domain.TaizhangModel;
import com.aidex.biz.service.TaizhangModelService;
import org.springframework.transaction.annotation.Transactional;
import com.aidex.common.utils.NumberUtils;

/**
 * 台账模版Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2025-05-13
 */
@Service
@Transactional(readOnly = true)
public class TaizhangModelServiceImpl extends BaseServiceImpl<TaizhangModelMapper, TaizhangModel> implements TaizhangModelService
{
    private static final Logger log = LoggerFactory.getLogger(TaizhangModelServiceImpl.class);

    /**
     * 获取单条数据
     * @param taizhangModel 台账模版
     * @return 台账模版
     */
    @Override
    public TaizhangModel get(TaizhangModel taizhangModel)
    {
        TaizhangModel dto = super.get(taizhangModel);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 台账模版id
     * @return 台账模版
     */
    @Override
    public TaizhangModel get(String id)
    {
        TaizhangModel dto = super.get(id);
        return dto;
    }


    /**
     * 查询台账模版列表
     * @param taizhangModel 台账模版
     * @return 台账模版
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<TaizhangModel> findList(TaizhangModel taizhangModel)
    {
        return super.findList(taizhangModel);
    }

    /**
     * 分页查询台账模版列表
     * @param taizhangModel 台账模版
     * @return 台账模版
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<TaizhangModel> findPage(TaizhangModel taizhangModel)
    {
        return super.findPage(taizhangModel);
    }

    /**
     * 保存台账模版
     * @param taizhangModel
     * @return 结果
     */
    @Override
    public boolean save(TaizhangModel taizhangModel)
    {
        return super.save(taizhangModel);
    }


    /**
     * 删除台账模版信息
     * @param taizhangModel
     * @return 结果
     */
    @Override
    public boolean remove(TaizhangModel taizhangModel)
    {
        return super.remove(taizhangModel);
    }

    /**
     * 批量删除台账模版
     * @param ids 需要删除的台账模版ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteTaizhangModelByIds(String[] ids)
    {
        return mapper.deleteTaizhangModelByIds(ids);
    }

    /**
     * 获取最大编号
     * @param taizhangModel 台账模版
     * @return 结果
     */
    @Override
    public int findMaxSort(TaizhangModel taizhangModel)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(taizhangModel));
    }
}
